
<?php $reviewdetails = TrainerProfileReview::getAllReviewTrainnerprofile($profiles->user_id); ?>
<section class="trainerProfilereview">
    <div class="container">
        <h4>Reviews</h4>
        <?php if (!empty($reviewdetails)) { ?> <a href="<?php echo Yii::app()->createAbsoluteUrl('TrainerProfileReview/trainerprofilereview', array('type' => $userType, 'skillusers' => $profiles->user_id))?>" id="review-all">see all</a><?php } ?>
        <a class="carousel-control left review-control1" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-up"></span></a>
        <a class="carousel-control right review-control2" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-down"></span></a>
        <hr> 
        <?php
        if (!empty($reviewdetails)) {
            $i = 1;
            foreach ($reviewdetails as $key => $value) {
                $profile = Users::getFrontEndUser($value->from_user_id);
                $imgsrc = ($profile['photo'] <> "") ? getRequestbaseUrl() . getuploadFolderDir() . $value->from_user_id . '/profile/minithumb/' . $profile['photo'] : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                ?>

                <div class="single-review">
                    <a href="#">
                        <img src="<?php echo $imgsrc; ?>" alt="">
                        <div class="review-info">
                            <div class="name"><?php echo $profile['first_name'] . '   ' . $profile['last_name']; ?></div>
                            <div class="title"><?php echo (strlen($value->reviews_text) > 250) ? substr($value->reviews_text, 0, 250) : substr($value->reviews_text, 0, 250); ?></div>
                        </div>
                    </a>
                </div><hr>
                <?php
            }
        } else {
            ?>
            <div class="item active"> 
                <div class="single-review">
                    <a href="javascript:void(0);">                                   
                        <div class="review-info">                                        
                            <?php echo Message:: NO_REVIEWS_MSG_TRAINER; ?> 
                        </div>
                    </a>
                </div><!--single-review-->
                <hr>                             
            </div>
        <?php } ?>

        <div class="single-review">
            <img src="<?php echo getWorkNoshopimage(SkillConfig::skill_myinbox_image); ?>" alt="">
            <div class="review-info">
                <form class="form-inline" role="form">
                    <div class="form-group">
                        <input type="text" class="form-control" id="review-text" placeholder="Add a review">
                    </div>
                </form> 
            </div>

        </div><!--single-review-->
    </div>
</section>